public class dxc implements Runnable {
    private int a=100;
    @Override
    public void run() {

        while (true){
            if (sut()==0){
                break;
            }
        }
    }

    private int sut() {

        if (a>0){
            a--;
            System.out.println(Thread.currentThread().getName()+" ");
            try {
                Thread.sleep(2);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            return 1;
        }else {
            return 0;
        }


    }
}
